package com.googlecode.contests_repo.core.users;

/**
 * Enumeration of all view access rights the system uses.
 * 
 * @author deni, petko
 */
public enum AccessRight {
	
	/**
	 * The user does not have access to the resource this right applies to.
	 */
	NONE,
	
	/**
	 * The user can view the name and title of a resource, i.e. he/she
	 * will simply know that the resource exists.
	 * This means that the user will see the resource when browsing its parent's
	 * content, but will not be provided with any additional information.
	 */
	LIST,
	
	/**
	 * The user can view the public information about the resource.
	 */
	VIEW,
	
	/**
	 * The user can view the whole information about the resource.
	 */
	VIEW_FULL;
	
	/**
	 * Checks whether the current right includes (is stronger than) the given one.
	 * 
	 * @param other
	 * 		the right for which to check
	 * @return
	 * 		true if the current right includes the given one, false otherwise
	 */
	public boolean includes(AccessRight other) {
		return ordinal() >= other.ordinal();
	}

}
